package rolePra.service.impl;

import rolePra.dao.RoleDao;
import rolePra.dao.impl.RoleDaoImpl;
import rolePra.model.Role;
import rolePra.service.RoleService;

import java.util.List;

public class RoleServiceImpl implements RoleService {

    //直接调用数据层
    RoleDao roleDao = new RoleDaoImpl();

    @Override
    public void insertRole(Role role) {
        //直接调用数据层的添加操作即可
        roleDao.addRole(role);
    }

    @Override
    public List<Role> getAllRoles() {
        List<Role> roles = roleDao.getRoles();
        //假设需要对roles中的数据进行过滤操作......
        //。。。。。。。
        return roles;
    }
}
